<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加员工</title>
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div>
    <form class="form-horizontal" id="updateSalaryInfo" >

        <div class="form-group">
            <label for="sid" class="col-sm-2 control-label">员工id</label>
            <div class="col-sm-3">
                <input type="text" th:value="${sid}" value="默认id" class="form-control" id="sid" name="sid" readonly>
            </div>
        </div>
        <div class="form-group">
            <label for="name"  class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-3">
                <input type="text" th:value="${name}" class="form-control" id="name" name="name" >
            </div>

        </div>

        <div class="form-group">
            <label for="month" class="col-sm-2 control-label">月份</label>
            <div class="col-sm-3">
                <input type="text" th:value="${month}" class="form-control" id="month" name="month" >
            </div>
        </div>


        <div class="form-group">
            <label for="basicSalary" class="col-sm-2 control-label">基本工资</label>
            <div class="col-sm-3">
                <input type="text" th:value="${basicSalary}" class="form-control" id="basicSalary" name="basicSalary" >
            </div>
        </div>


        <div class="form-group">
            <label for="bonus" class="col-sm-2 control-label">奖金</label>
            <div class="col-sm-3">
                <input type="text" th:value="${bonus}" class="form-control" id="bonus" name="bonus" >
            </div>
        </div>

        <div class="form-group">
            <label for="deduct" class="col-sm-2 control-label">扣除工资</label>
            <div class="col-sm-3">
                <input type="text" th:value="${deduct}" class="form-control" id="deduct" name="deduct" >
            </div>
        </div>

        <div class="form-group">
            <label for="actualSalary" class="col-sm-2 control-label">实发工资</label>
            <div class="col-sm-3">
                <input type="text" th:value="${actualSalary}" class="form-control" id="actualSalary" name="actualSalary" >
            </div>
        </div>

        <div class="form-group">
            <label for="remarks" class="col-sm-2 control-label">备注</label>
            <div class="col-sm-3">
                <input type="text" th:value="${remarks}" class="form-control" id="remarks" name="remarks" >
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" class="btn btn-primary" id="updateSalaryBySidMon">修改</button>
                <button type="button" class="btn btn-primary" onclick="loadPage('personalSalary')" id="returnIndex">返回</button>
            </div>
        </div>
    </form>
</div>
</body>
<script>
    $(document).ready(function (){
        $("#updateSalaryBySidMon").on("click",function (){
            var data0=$("#updateSalaryInfo").serialize()
            $.ajax({
                url:"/personSalary/updateBySidMon",
                type: "POST",
                dataType: "text",
                data:data0,
                success:function (){
                    alert("修改工资成功！")
                },
                error:function (){
                    alert("修改工资失败！")
                }

            })
        })
    })

    function loadPage(url) {
        var sid0=$("#sid").val()
        $.get(url,{sid:sid0},function(data,status){
            $("#right").html(data);
        });
    }
</script>
</html>